<template>
  <div>
    <headers></headers>
        <van-row>
            <van-col span="5">
              <left/>
            </van-col>
            <van-col span="19">
              <table border="1" cellspacing="1">
                <tr>
                  <td>文章</td>
                  <td>操作</td>
                </tr>
                <tr v-for="i in wzlist" :key="i.id">
                  <td>{{i.title}}</td>
                  <td>
                    <van-button @click="tg(i.id)">通过</van-button>
                    <van-button @click="btg(i.id)">不通过</van-button>
                  </td>
                </tr>
              </table>
              <van-button to="addprize" text="去添加奖品"/>
              <van-button to="addarticle" text="去添加文章"/>
              <van-button to="fictionaudit" text="查看审核过程"/>
            </van-col>
         </van-row>
  </div>
</template>

<script>
import maxios from "@/http/axios";
import headers from '../comm/headers.vue'
import left from '../comm/left.vue'
export default {
  components:{
        'headers':headers,
        'left':left,
    },
  data() {
    return {
      wzlist: []
    }
  },
  methods:{
    get_wzlist(){
      maxios('getessay','get').then(res=>{
        this.wzlist = res.list
      })
    },
    tg(id){
      maxios('fpass?id='+id,'get').then(res=>{
        if(res.code==200){
          alert('ok')
          this.get_wzlist()
        }
        else {
          alert('no')
        }
      })
    },
    btg(id){
      maxios('nopass?id='+id,'get').then(res=>{
        if(res.code==200){
          alert('ok')
          this.get_wzlist()
        }
        else {
          alert('no')
        }
      })
    }
  },
  mounted() {
    this.get_wzlist()
  }
}
</script>

<style scoped>

</style>